//
//  NewsItem.m
//  iMADE
//
//  Created by Ed Knutson on 10/22/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "NewsItem.h"

#import "Convert.h"

@implementation NewsItem

@synthesize title, summary, link, publishDate;

- (id)initWithDictionary:(NSDictionary *)dict {
	if(self = [super init]) {
		self.title = [dict valueForKey:@"Title"];
		self.summary = [dict valueForKey:@"Summary"];
		self.link = [dict valueForKey:@"Link"];
		NSString *published = [dict valueForKey:@"PublishDate"];
		if(published != nil)
			self.publishDate = [Convert dateFromString:published];
		else self.publishDate = nil;
	}
	return self;
}

@end
